<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ajax异步交互</title>
</head>
<body>

</body>
<!--ajax-->
<script src="js/jquery-3.3.1.min.js"></script>
<script>
    $.ajax({
        type: 'post',
        // url: 'ajax/test1',
        // url: 'ajax/test2',
        url: 'json/test5',
        //    传输数据使用json
        // contentType: 'application/json;charset:utf-8',
        // data: '{"username":"admin","age":18}',
        data:'username=manage&age=18',
        //成功回调函数
        success:function (data) {
            alert("ok" + data);
        },
        error:function () {
            alert("error");
        }
    });
</script>


</html>